var e, t = function(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}(require("../../../utils/tools.js"));

getApp();

Page({
    data: {
        marginLeft: 0,
        displayType: "block",
        scrollTime: 0,
        selectIndex: 0,
        scrollViewHeight: 0,
        pageName: "db"
    },
    onLoad: function(t) {
        e = this;
    },
    onReady: function() {},
    animationfinish: function(e) {
        this.setData({
            scrollViewHeight: 0 == this.data.selectIndex ? 270 * this.data.running_period_list.length : this.data.ending_period_list.length > 0 ? 270 * this.data.ending_period_list.length : 600
        });
    },
    swiperChange: function(e) {
        this.setData({
            selectIndex: e.detail.current
        });
    },
    btnClick: function(e) {
        this.setData({
            selectIndex: e.currentTarget.id
        });
    },
    onShow: function() {
        var n = {
            action: "index",
            contr: "treasure",
            token: wx.getStorageSync("token")
        };
        t.default.request(n, function(t) {
            e.setData(t.info), e.animationfinish();
        });
    },
    onHide: function() {},
    jumptreasure: function(e) {
        var t = e.currentTarget.dataset.id;
        wx.navigateTo({
            url: "../detail/detail?id=" + t
        });
    },
    gotoLog: function() {
        wx.navigateTo({
            url: "/bh_farm/pages/record/record"
        });
    },
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    navigatorSwitch: function(e) {
        console.log(e.detail.pageName);
        var t = e.detail.pageName;
        if (t != this.data.pageName) {
            if ("index" == t) n = "/bh_farm/pages/index/index"; else if ("recruit" == t) n = "/bh_farm/pages/recruit/recruit"; else if ("pdd" == t) n = "/bh_farm/pages/pdd/pdd"; else if ("mine" == t) var n = "/bh_farm/pages/my/my";
            wx.redirectTo({
                url: n
            });
        }
    },
    onShareAppMessage: function() {}
});